<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 字符串根据/拆分数组，并去除元素的前后空格，返回非空数据
    let data = '1/ 2 / 3/'
    // let data = ''
    data = data.split('/').map(mItem => {
      return mItem.trim()
    }).filter(fItem => fItem)
    console.log('data', data)
  </script>
</body>

</html>